agora inbox for [email protected]
help / color / mirror / Atom feedRe: Chronic performance issue with Replication Failover and FSM.
965+ messages / 3 participants
[nested] [flat]
* Re: Chronic performance issue with Replication Failover and FSM.
@ 2012-08-30 07:54 Daniel Farina <[email protected]>
0 siblings, 1 reply; 965+ messages in thread
From: Daniel Farina @ 2012-08-30 07:54 UTC (permalink / raw)
To: Josh Berkus <[email protected]>; +Cc: pgsql-hackers
On Tue, Mar 13, 2012 at 4:53 PM, Josh Berkus <[email protected]> wrote:
> 4. On a high-UPDATE workload, this means that the replica assumes tables
> have no free space until it starts to build a new FSM or autovacuum
> kicks in on some of the tables, much later on.
>
> 5. If your hosting is such that you fail over a lot (such as on AWS),
> then this causes cumulative table bloat which can only be cured by a
> VACUUM FULL.
I'd like to revive this thread. Like other people, I thought this was
not a huge problem -- or least maybe not directly from the mechanism
proposed -- but sometimes it's a pretty enormous one, and I've started
to notice it. I did a bug report here
(http://archives.postgresql.org/pgsql-bugs/2012-08/msg00108.php, plots
in http://archives.postgresql.org/pgsql-performance/2012-08/msg00181.php),
but just today we promoted another system via streaming replication to
pick up the planner fix in 9.1.5 (did you know: that planner bug seems
to make GIN FTS indexes un-used in non-exotic cases, and one goes to
seqscan?), and then a 40MB GIN index bloated to two gigs on a 1.5GB
table over the course of maybe six hours.
In addition, the thread on pgsql-performance that has the plot I
linked to indicates someone having the same problem with 8.3 after a
warm-standby promotion.
So I think there are some devils at work here, and I am not even sure
if they are hard to reproduce -- yet, people use standby promotion
("unfollow") on Heroku all the time and we have not been plagued
mightily by support issues involving such incredible bloating, so
there's something about the access pattern. In my two cases, there is
a significant number of UPDATEs vs actual number of INSERTs/DELETES of
records (the ratio is probably 10000+ to 1), even though neither of
these would be close to what one could consider a large or even
medium-sized database in terms of TPS or database size. In fact, the
latter system bloated even though it comfortably fits entirely in
memory.
--
fdr
^ permalink raw reply [nested|flat] 965+ messages in thread
* Re: Chronic performance issue with Replication Failover and FSM.
@ 2012-08-30 14:05 Tom Lane <[email protected]>
parent: Daniel Farina <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Tom Lane @ 2012-08-30 14:05 UTC (permalink / raw)
To: Daniel Farina <[email protected]>; +Cc: Josh Berkus <[email protected]>; pgsql-hackers
Daniel Farina <[email protected]> writes:
> but just today we promoted another system via streaming replication to
> pick up the planner fix in 9.1.5 (did you know: that planner bug seems
> to make GIN FTS indexes un-used in non-exotic cases, and one goes to
> seqscan?), and then a 40MB GIN index bloated to two gigs on a 1.5GB
> table over the course of maybe six hours.
I think this is probably unrelated to what Josh was griping about:
even granting that the system forgot any free space that had been
available within the original 40MB, that couldn't in itself lead
to eating more than another 40MB, no? My guess is something is
broken about the oldest-xmin-horizon mechanism, such that VACUUM
is failing to recover space. Can you put together a self-contained
test case that exhibits similar growth?
regards, tom lane
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 965+ messages in thread
From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 3 +-
.../pgoutput_repack/pgoutput_repack.c | 54 +++++++++----------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
/*
* Next, read any attributes we stored separately into the tts_values
- * array elements expecting them, if any. This matches store_change.
+ * array elements expecting them, if any. This matches
+ * repack_store_change.
*/
BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
PG_MODULE_MAGIC;
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple);
void
_PG_output_plugin_init(OutputPluginCallbacks *cb)
{
- cb->startup_cb = plugin_startup;
- cb->begin_cb = plugin_begin_txn;
- cb->change_cb = plugin_change;
- cb->commit_cb = plugin_commit_txn;
- cb->shutdown_cb = plugin_shutdown;
+ cb->startup_cb = repack_startup;
+ cb->begin_cb = repack_begin_txn;
+ cb->change_cb = repack_process_change;
+ cb->commit_cb = repack_commit_txn;
+ cb->shutdown_cb = repack_shutdown;
}
/* initialize this plugin */
static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init)
{
ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
if (ctx->output_plugin_options != NIL)
{
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("This plugin does not expect any options")));
+ errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("this plugin does not expect any options"));
}
}
static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
{
}
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
/* BEGIN callback */
static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
{
}
/* COMMIT callback */
static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn)
{
}
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* Callback for individual changed tuples
*/
static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
- Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+ Relation relation, ReorderBufferChange *change)
{
RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (newtuple == NULL)
elog(ERROR, "incomplete insert info.");
- store_change(ctx, relation, CHANGE_INSERT, newtuple);
+ repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
elog(ERROR, "incomplete update info.");
if (oldtuple != NULL)
- store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
- store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+ repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
}
break;
case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
if (oldtuple == NULL)
elog(ERROR, "incomplete delete info.");
- store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+ repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
}
break;
default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
* replication identity instead of the full tuple.
*/
static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
- ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+ ConcurrentChangeKind kind, HeapTuple tuple)
{
RepackDecodingState *dstate;
MemoryContext oldcxt;
--
2.47.3
--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"
^ permalink raw reply [nested|flat] 965+ messages in thread
end of thread, other threads:[~2026-03-23 20:37 UTC | newest]
Thread overview: 965+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-08-30 07:54 Re: Chronic performance issue with Replication Failover and FSM. Daniel Farina <[email protected]>
2012-08-30 14:05 ` Tom Lane <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox